package com.lengchangjing.BehavioralPatterns.CommandPattern.example;


public class Invoker {

    private CommandQueue commandQueue;

    public Invoker(CommandQueue commandQueue) {
        this.commandQueue = commandQueue;
    }

    public void setCommandQueue(CommandQueue commandQueue) {
        this.commandQueue = commandQueue;
    }

    public void call() {
        commandQueue.execute();
    }

    public void unDo() {
        LogUtil.getPreviousLog();
    }

    public void reDo() {
        LogUtil.getNextLog();
    }

}
